const http = uni.$u.http


// 查询活动
export const getDaoTaskPageList = (data) => {
	let {
		pageNo,
		pageSize,
	} = data
	return http.post('', {
		serviceName: 'DaoTaskService',
		methodName: 'getPageList',
		bizParams: {
			...data
		},
		pagination: {
			pageNum: pageNo,
			pageSize
		}
	})
}

// 查询任务详情
export const reqDaoTaskDetails = (data) => {
	return http.post('', {
		serviceName: 'DaoTaskService',
		methodName: 'getTaskDetails',
		bizParams: {
			...data
		}
	})
}

// 认领任务
export const claimTask = (data) => {
	return http.post('', {
		serviceName: 'DaoTaskService',
		methodName: 'claimTask',
		bizParams: {
			...data
		}
	})
}

// 提交完成的任务
export const submitTask = (data) => {
	return http.post('', {
		serviceName: 'DaoTaskService',
		methodName: 'submitTask',
		bizParams: {
			...data
		}
	})
}

// 查询我认领任务
export const getMyClaimedTasks = (data) => {
	let {
		pageNo,
		pageSize,
	} = data
	return http.post('', {
		serviceName: 'DaoTaskService',
		methodName: 'getMyClaimedTasks',
		bizParams: {
			...data
		},
		pagination: {
			pageNum: pageNo,
			pageSize
		}
	})
}

// 查询我发布的任务
export const getMyPublishTasks = (data) => {
	let {
		pageNo,
		pageSize,
	} = data
	return http.post('', {
		serviceName: 'DaoTaskService',
		methodName: 'getMyPublishTasks',
		bizParams: {
			...data
		},
		pagination: {
			pageNum: pageNo,
			pageSize
		}
	})
}